import { Module } from '@nestjs/common';
import { PointsService } from './points.service';
import { PointsController } from './points.controller';
import { PointsGoodsModule } from './points-goods/points-goods.module';
import { RouterModule } from '@nestjs/core';
import { PointsLogModule } from './points-log/points-log.module';
import { PointsRulesModule } from './points-rules/points-rules.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { PointsEntity } from './points.entity';

const modules = [PointsGoodsModule, PointsLogModule, PointsRulesModule];

@Module({
  imports: [
    RouterModule.register([
      {
        path: 'cms/points',
        module: PointsModule,
        children: [...modules],
      },
    ]),
    TypeOrmModule.forFeature([PointsEntity]),
    ...modules,
  ],
  controllers: [PointsController],
  providers: [PointsService],
  exports: [PointsService, ...modules, TypeOrmModule],
})
export class PointsModule {}
